home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Edit box & SetWindowText?
- Date: Thu, 18 Apr 1996 10:34:29 -0400
- Organization: Datalytics, Inc
- Message-ID: <317652F5.66CA@datalytics.com>
- References: <2c4_9604160250@csource.blaze.net.au>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Edward Connor wrote:
- >
- > Hi All
- >
- > Why are things never as straight forward as they appear they can/should be?
- >
- > Or is it me???
- >
- > I create an edit box as the book, my bible, shows me (ie: Teach Yourself
- > Windows Programming in 21 Days) using CreateWindow(...). [Day 10]
- > Then I insert text into it using SetWindowText(...)
- >
- > According to the book this "is a fairly simple process" which it is, but,
- > the carriage returns do not initiate new lines. Instead all I get in the
- > edit box instead of a carriage return is a small vertical line.
- >
- > I have discovered that if I add a new line thing '\n' to the cr thing '\r'
- > then there will occur a new line break in the script, but this is not a
- > very efficient way to go about things. I have experimented with all the
- > ES_... and WS_... things in the construction of the edit box, but to no
- > avail.
- >
- > There must be a 'proper' way to do it, but????
- >
- > Thanks to any one who can assist
-
- We've found that we need \n\r as well. Apparently, \n is
- translated into a linefeed only. \r is just a carriage return,
- not a return and a linefeed. By contrast, the Enter key
- normally issues a carriage return/linefeed pair. \r is
- analogous to moving the platten on a mechanical typewriter to
- return the left side. A linefeed (\n in this case) is analogous
- to rolling the platten to the next line. The Enter key, then,
- is analogous to hitting the lever that moves the platten back to
- the left side and rolls the platten to the next line all at
- once.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-